package org.zfes.snowier.cloud.zbss.pmp.router.service.test;

import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.zfes.snowier.core.data.DataSet;
import org.zfes.snowier.core.util.ZStrUtil;
import org.zfes.snowier.web.controller.BaseController;
import org.zfes.snowier.auth.shiro.util.SecurityUtil;
import org.zfes.snowier.cloud.zbss.pmp.dto.PmpBugsCreateDto;
import org.zfes.snowier.cloud.zbss.pmp.service.IPmpBugsService;
@Controller("org.zfes.snowier.cloud.zbss.pmp.router.service.test.pmpBugsController") 
@RequestMapping("/pmp/service/test/pmpBugs")
public class PmpBugsController extends BaseController {
	
	@Autowired
	private IPmpBugsService pmpBugsService;
	
    @RequestMapping(value="/loadPmpBugsDataSet", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object loadPmpBugsDataSet(@RequestParam Map<String,Object> params){
	    DataSet dataSet=  pmpBugsService.loadPmpBugsDataSet(params);
	    return ajaxQuery("dataSet", dataSet);
    }
    
    
    @RequestMapping(value="/createPmpBugs", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public  @ResponseBody Object createPmpBugs(PmpBugsCreateDto createDto){
		pmpBugsService.createPmpBugs(SecurityUtil.getUserId().get(),createDto);
    	return ajaxDoneSuccess("数据操作成功 ");
    }
  
    @RequestMapping(value="/checkBugs", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public  @ResponseBody Object  checkBugs(String ids, Byte accept) {
    	pmpBugsService.testerCheckBugs(ZStrUtil.splitLong(ids),accept);
    	return ajaxDoneSuccess("数据操作成功 ");
    }


}